package com.coolwar.api.internal;

import com.coolwar.model.vo.VoFenci;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 分词服务
 *
 * @author Coolwar
 */
@Service
public class FenciApi {

    public static final String SERVER_NAME = "http://FENCI";

    @Resource
    private RestTemplate restTemplate;

    public VoFenci sentenceProcess(String sentence) {
        Map<String, Object> param = new HashMap<>(2);
        param.put("sentence", sentence);
        return restTemplate.postForObject(SERVER_NAME + "/v1/sentenceProcess", param, VoFenci.class, new HashMap<>(1));
    }
}
